package com.service;

import com.pojo.Employee;
import com.pojo.view.EmpAndLeaveApply;
import com.pojo.LeaveApply;
import com.pojo.view.LeaveApplyCheck;

import java.util.List;

public interface LeaveApplyService {

    /**
     * 将一条leaveApply记录添加至数据库表tb_leaveapply
     * @param leaveApply
     */
    void addToLeaveApply(LeaveApply leaveApply);

    /**
     * 将员工对应的leaveApply记录添加数据库表tb_emp_leaveapply
     * @param empAndLeaveApply
     */
    void addToEmpLeaveApply(EmpAndLeaveApply empAndLeaveApply);

    /**
     * 根据applytime查找id
     * @param applyTime
     * @return
     */
    int getLeaveApplyIdByApplyTime(String applyTime);

    /**
     * 查找status为“正在审核”的leaveapply集合
     * @return
     */
    List<LeaveApply> getLeaveApplyChecks();

    /**
     * 根据leaveapply_id查找对应的员工
     * @return
     */
    Employee getEmployeeByLeaveApplyId(int leaveApplyId);

    /**
     * 根据leaveapply_id修改相应申请的status为“已通过”
     * @param leaveapply_id
     */
    void updateStatusToApprovedById(int leaveapply_id);

    /**
     * 根据leaveapply_id查找对应的请假申请
     * @param leaveApplyId
     * @return
     */
    LeaveApply getLeaveApplyByLeaveApplyId(int leaveApplyId);

    /**
     * 根据username查找对应的请假申请Id
     * @param username
     * @return
     */
    List<Integer> getLeaveApplyIdListByUsername(String username);

    /**
     * 查找"正在审核"的申请数目
     * @return
     */
    Integer getWaitToCheckOfAll();

    /**
     * 根据leaveapply_id修改相应申请的status为“未通过”
     * @param leaveApplyId
     */
    void updateStatusToRefusedById(int leaveApplyId);
}
